<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@include file="/resource/common/taglib.jspf"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>添加</title>
<%@include file="/resource/common/jquery.jspf"%>
<%@include file="/resource/common/bootstrap.jspf"%>
<%@include file="/resource/common/validate.jspf"%>
<%@include file="/resource/common/kindeditor.jspf"%>
<%@include file="/resource/common/ztree.jspf"%>
<%@include file="/resource/common/wdate-picker.jspf"%>
<link rel="stylesheet" href="${ctxStatic}/plugins/upload/image.css" type="text/css" media="screen" />
<script type="text/javascript" src="${ctxStatic }/js/system/asyncDoSubmitForm.js"></script>
<script type="text/javascript" src="${ctxStatic }/plugins/upload/uploadImageUtils.js"></script>

</head>
<body>
	<div id="body-wrapper">
		<div id="main-content">
			<div class="content-box" >
				<div class="content-box-content">
					<div class="tab-content default-tab" id="tab1">
						<fieldset>
							<input type="hidden" id="asyncResult" name="asyncResult" value="-1" /> 
							<input type="hidden" id="asyncResultData" name="asyncResultData" value="-1" /> 
							<input type="hidden" id="asyncResultError" name="asyncResultError" value="-1" />
							<form:form id="inputForm" name="form1" class="form-horizontal" method="post" action="addWebCounselor.do" modelAttribute="WebCounselor">
								<div class="row">
									<div class="col-md-6 col-sm-6 col-xs-6" >
										<input type="hidden" id="id" name="id" value="${entity.id}" /> 
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">中文名:<span style="color: red">*</span></label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.chineseName}" name="chineseName" id="chineseName"  placeholder="中文名"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">英文名:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.englishName}" name="englishName" id="englishName"  placeholder="英文名"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">职称:<span style="color: red">*</span></label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.jobTitle}" name="jobTitle" id="jobTitle"  placeholder="职称"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">性别:<span style="color: red">*</span></label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.gender}" name="gender" id="gender"  placeholder="性别"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">星座:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.constellation}" name="constellation" id="constellation"  placeholder="星座"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">家乡:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.hometown}" name="hometown" id="hometown"  placeholder="家乡"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">经验(年):</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.experience}" name="experience" id="experience"  placeholder="经验(年)"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">血型:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.blood}" name="blood" id="blood"  placeholder="血型"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">负责城市:<span style="color: red">*</span></label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<select name="cityId" id="cityId" class="form-control input-sm">
													<option value="">==请选择==</option>
													<c:forEach var="item" items="${city_list }" varStatus="s">
														<option value="${item.id}" <c:if test="${item.id == entity.cityId }"> selected="selected"</c:if>> ${item.chineseName } </option>
													</c:forEach>
												</select>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">工作地点:<span style="color: red">*</span></label>
											<div class="col-md-10 col-sm-10 col-xs-10">

												<select name="locationId" id="locationId" class="form-control input-sm">
													<option value="">==请选择==</option>
													<c:forEach var="item" items="${location_list }" varStatus="s">
														<option value="${item.id}" <c:if test="${item.id == entity.locationId }"> selected="selected"</c:if>> ${item.title } </option>
													</c:forEach>
												</select>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">专业,特长:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.specialty}" name="specialty" id="specialty"  placeholder="专业,特长"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">QQ:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.qq}" name="qq" id="qq"  placeholder="QQ"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">MSN:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.msn}" name="msn" id="msn"  placeholder="MSN"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">微博:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.weiBo}" name="weiBo" id="weiBo"  placeholder="微博"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">微信:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.weiXin}" name="weiXin" id="weiXin"  placeholder="微信"/>
											</div>
										</div>
									</div>
									<div class="col-md-6 col-sm-6 col-xs-6" >
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">主页:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.homePage}" name="homePage" id="homePage"  placeholder="主页"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">QQ空间:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.qqZone}" name="qqZone" id="qqZone"  placeholder="QQ空间"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">邮箱:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.email}" name="email" id="email"  placeholder="邮箱"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">婚姻:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.marriage}" name="marriage" id="marriage"  placeholder="婚姻"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">座机:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.tel}" name="tel" id="tel"  placeholder="座机"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">成功案例:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.estatecase}" name="estatecase" id="estatecase"  placeholder="成功案例"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">满意度:<span style="color: red">*</span></label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.satisfaction}" name="satisfaction" id="satisfaction"  placeholder="满意度"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">手机:<span style="color: red">*</span></label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.phone}" name="phone" id="phone"  placeholder="手机"/>
											</div>
										</div>
										<%--<div class="form-group">--%>
											<%--<label class="col-md-2 col-sm-2 col-xs-2 control-label">头像:</label>--%>
											<%--<div class="col-md-10 col-sm-10 col-xs-10">--%>
												<%--<input type="text" class="form-control input-sm" value="${entity.photo}" name="photo" id="photo"  placeholder="头像"/>--%>
											<%--</div>--%>
										<%--</div>--%>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">头像：<span style="color: red">*</span></label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="hidden" id="photo" name="photo" value="${entity.photo }"/>
												<input type="hidden" id="filedata" name="filedata" />
												<input type="hidden" id="fileext" name="fileext" />
												<div id="uploadPreview" class="uploadPreview">
													5M大小以内
												</div>
											</div>
										</div>
										<div class="form-group form-group-sm">
											<label for="formGroupInputSmall" class="col-md-2 col-sm-2 col-xs-2 control-label"></label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input id="uploadImage" type="file" name="photoimage" class="fimg1" />
											</div>
										</div>
										<div  style="color: red;text-align: center;margin-bottom: 10px;margin-left: -150px;" id="msg"></div>

										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">参加工作时间:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="<fmt:formatDate value="${entity.joinTime}" pattern="yyyy-MM-dd" />" onfocus="dateUtils.show_YMD(0,'joinTime')"  name="joinTime" id="joinTime"  placeholder="参加工作时间"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">浏览数:<span style="color: red">*</span></label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${empty entity.pageView?"0":entity.pageView}" name="pageView" id="pageView"  placeholder="浏览数"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">排序:<span style="color: red">*</span></label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${empty entity.sort?"10":entity.sort}" name="sort" id="sort"  placeholder="排序"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">是否推荐:<span style="color: red">*</span></label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<select name="isRecommend" id="isRecommend" class="form-control input-sm">
													<option value="true" <c:if test="${entity.isRecommend==true }">selected="selected"</c:if>>是</option>
													<option value="false" <c:if test="${entity.isRecommend==false }">selected="selected"</c:if>>否</option>
												</select>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">状态:<span style="color: red">*</span></label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<select name="status" id="status" class="form-control input-sm">
													<option value="true" <c:if test="${entity.status==true }">selected="selected"</c:if>>开启</option>
													<option value="false" <c:if test="${entity.status==false }">selected="selected"</c:if>>关闭</option>
												</select>
											</div>
										</div>
									</div>
								</div>

								<div class="row">
									<div class="col-md-12 col-sm-12 col-xs-12" >
										<div class="form-group">
											<label class="col-md-1 col-sm-1 col-xs-1 control-label">seoTitle:</label>
											<div class="col-md-11 col-sm-11 col-xs-11">
												<input type="text" class="form-control input-sm" value="${entity.seoTitle}" name="seoTitle" id="seoTitle"  placeholder="seoTitle"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-1 col-sm-1 col-xs-1 control-label">seoKeywords:</label>
											<div class="col-md-11 col-sm-11 col-xs-11">
												<input type="text" class="form-control input-sm" value="${entity.seoKeywords}" name="seoKeywords" id="seoKeywords"  placeholder="seoKeywords"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-1 col-sm-1 col-xs-1 control-label">seoDescription:</label>
											<div class="col-md-11 col-sm-11 col-xs-11">
												<input type="text" class="form-control input-sm" value="${entity.seoDescription}" name="seoDescription" id="seoDescription"  placeholder="seoDescription"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-1 col-sm-1 col-xs-1 control-label">个人简介:</label>
											<div class="col-md-11 col-sm-11 col-xs-11">
												<textarea id="description" name="description" style="width: 100%; height: 200px; visibility: hidden;">${entity.description }</textarea> 您当前输入了 <span class="word_count_description">0</span> 个文字。（字数统计包含纯文本、IMG、EMBED，不包含换行符，IMG和EMBED算一个文字。）
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-1 col-sm-1 col-xs-1 control-label">个人情况:</label>
											<div class="col-md-11 col-sm-11 col-xs-11">
												<textarea id="personalInfo" name="personalInfo" style="width: 100%; height: 200px; visibility: hidden;">${entity.personalInfo }</textarea> 您当前输入了 <span class="word_count_personalInfo">0</span> 个文字。（字数统计包含纯文本、IMG、EMBED，不包含换行符，IMG和EMBED算一个文字。）
											</div>
										</div>
									</div>
								</div>
							</form:form>
						</fieldset>
					</div>
				</div>
			</div>
		</div>
	</div>
<script type="text/javascript">
var result = 0;
var validateForm;
$(document).ready(function() {
	validateForm = $("#inputForm").validate({
		rules : {
			chineseName : {
				required : true
			},
			email:{
			  email:true
			},
			jobTitle : {
				required : true
			},
			gender : {
				required : true
			},
			cityId : {
				required : true
			},
			locationId : {
				required : true
			},
			satisfaction : {
				required : true
			},
			phone : {
				required : true
			},
			sort : {
				required : true
			},
			isRecommend : {
				required : true
			},
			status : {
				required : true
			}
		},
		messages : {
			chineseName : {
				required : "中文名不能为空"
			},
            email:{
                email:"邮箱格式不正确"
            },
			jobTitle : {
				required : "职称不能为空"
			},
			gender : {
				required : "性别不能为空"
			},
			cityId : {
				required : "城市（美国城市）不能为空"
			},
			locationId : {
				required : "工作地点不能为空"
			},
			phone : {
				required : "手机不能为空"
			},
			sort : {
				required : "排序不能为空"
			},
			isRecommend : {
				required : "是否推荐不能为空"
			},
			status : {
				required : "状态不能为空"
			}
		},
		errorElement : "em",
		errorClass : "validate_error",
		submitHandler: function(form) { //通过之后回调
		},
		invalidHandler: function(form, validator) {
			return false;
		}
	});

    //初始在线编辑器
    ShowEditorHtml("#description", "word_count_description");
    ShowEditorHtml("#personalInfo", "word_count_personalInfo");

    $("#uploadImage").imageUploadUtils({
        data : "#filedata",
        ext : "#fileext",
        msg : "#msg",
        preview : "#uploadPreview",
    });

    var photo = "${entity.photo}";
    var bg = "resource/images/no_photo.png";
    if(photo!=''){
        bg = photo;
    }
    $("#uploadPreview").css("background-image", "url("+bg+")");
});

</script>	
</body>
</html>